import React, {Component} from 'react';
import {
  View,
  Text,
  TouchableOpacity,
} from 'react-native';

import Config from '../../config';
import Colors from '../../common/Colors';
import CommonStyles from '../../common/CommonStyles';
import SizeUtils from '../../common/SizeUtils';
import CommonListPage from '../common/CommonListPage';
import SportUserItem from './SportUserItem';
import SportRequestUserListAction from '../../actions/sport/SportRequestUserListAction';

export default class SportUserListPage extends CommonListPage {
  constructor(props) {
    super(props);

    this._itemClickEnable = false;
    this._dataKey = "by_user_id";
  }

  _onPressItem(data) {

  }

  _onRenderItem(data, index) {
    return (
      <SportUserItem data={data} index={index+1} showNum = {true}
      style={{width:SizeUtils.getWindowSize().width}}/>
    )
  }

  _getListViewStyle() {
    return {
        width:SizeUtils.getWindowSize().width,
        height:(SizeUtils.getWindowSize().height - Config.paddingTop - SizeUtils.translateDesignHeightToCode(40)),
        backgroundColor:"#ffffff00"};
  }

  _requestData(page, listView) {
    new SportRequestUserListAction().call(listView, {page:page, sort_id:this.props.pageData.routeData.sort_id, page_size:10});
  }

  _getTitle() {
    return this.props.pageData.routeData.name;
  }
}
